# 读取text1.txt和text2.txt的内容
with open("text1.txt", "r") as file1, open("text2.txt", "r") as file2:
    content1 = file1.readline().strip()
    content2 = file2.readline().strip()

# 合并并排序两个文件的内容
merged_content = sorted(content1 + content2)

# 将结果写入out.txt文件
with open("out.txt", "w") as outfile:
    outfile.write(''.join(merged_content))

print("已完成合并排序")
